import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

export default new Router({
  routes:[
    {
      path:'/login',
      component:()=> import('../views/Login'),
    },
    {
      path:'/main',
      name:'main',
      component:()=> import('../views/Main'),

      children:[{
        path:'/login',
        component:()=>import('../views/Login'),
      }

      ],
      beforeEnter:(to,from,next)=>{
        console.log('我进入了main模板');
        console.log(to);
        console.log(from);
        next();
    }},
    {
      path: '*',
      component: ()=>import('../views/Error')
    },
    {
      path:'/count',
      component:()=>import('../views/Count')
    },
    {
      path:'/axios',
      component:()=>import('../views/Axios')
    },

  ]
})
